# coding=utf-8
from flask import Flask, render_template, Blueprint
from flask import request, redirect

from cloud_testing.utils import register_ip


# 公共的方法
common = Blueprint('common', __name__,
                       url_prefix='/common',
                       template_folder='templates',
                       static_folder='static')

# 注册节点
@common.route('/register', methods=['POST', 'GET'])
def register():
    if request.method == 'POST':
        ip = request.form['ip']
        port = request.form['port']
        register_ip(ip, port)        
    return "success" 


@common.route('/')
def index():
    return render_template('content.html',introduce={}, shouye=True)
   
                 
